﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Movimientos.ascx.vb"
    Inherits="Content_Portafolio_Port_controls_Movimientos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<style type="text/css">
   
    .tablaBusqueda
    {
        width: 95%;
    }
   
    .Gridview
    {}
    .tabla2
    {
        margin-bottom: 0px;
    }
   
</style>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<center>
<div class="divContent">
    <%--<div class="titulos2"></div>--%>
    <div class="tablas">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
            <ContentTemplate>
                <table class="tablaDatosUsuario">
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="Tipo de Operacion"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddltipo" runat="server" AutoPostBack="true" Width="100px">
                                <asp:ListItem Value="Deposito">Depósito</asp:ListItem>
                                <asp:ListItem Value="Retiro">Retiro</asp:ListItem>
                                <asp:ListItem Value="Rendimiento">Rendimiento</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label9" runat="server" Text="Despacho"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddl_desp" runat="server" Width="150px" AutoPostBack="true"> 
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddl_desp"
                                Display="none" ErrorMessage="Campo Obligatorio!" ForeColor="red" InitialValue="None"
                                ValidationGroup="g1" />
                            <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="Server" CloseImageUrl="~/images/close.gif"
                                CssClass="validatorCallout" HighlightCssClass="validatorCalloutHighlight" PopupPosition="Right"
                                TargetControlID="RequiredFieldValidator2" WarningIconImageUrl="~/images/Warning.png" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label5" runat="server" Text="Institución"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddl_inst" runat="server" Width="150px" AutoPostBack="true">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddl_inst"
                                Display="none" ErrorMessage="Campo Obligatorio!" ForeColor="red" InitialValue="None"
                                ValidationGroup="g1" />
                            <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="Server" CloseImageUrl="~/images/close.gif"
                                CssClass="validatorCallout" HighlightCssClass="validatorCalloutHighlight" PopupPosition="Right"
                                TargetControlID="RequiredFieldValidator3" WarningIconImageUrl="~/images/Warning.png" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label8" runat="server" Text="Cliente"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList id="ddlC" runat="server" AutoPostBack="true"  Width="150px">
                                </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="ddlC"
                                Display="none" ErrorMessage="Campo Obligatorio!" ForeColor="red" InitialValue="None"
                                ValidationGroup="g1" />
                            <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="Server" CloseImageUrl="~/images/close.gif"
                                CssClass="validatorCallout" HighlightCssClass="validatorCalloutHighlight" PopupPosition="Right"
                                TargetControlID="RequiredFieldValidator4" WarningIconImageUrl="~/images/Warning.png" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label6" runat="server" Text="Contrato"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlCon" runat="server" AutoPostBack="true"   Width="150px">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddlCon"
                                Display="none" ErrorMessage="Campo Obligatorio!" ForeColor="red" InitialValue="None"
                                ValidationGroup="g1" />
                            <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="Server" CloseImageUrl="~/images/close.gif"
                                CssClass="validatorCallout" HighlightCssClass="validatorCalloutHighlight" PopupPosition="Right"
                                TargetControlID="RequiredFieldValidator5" WarningIconImageUrl="~/images/Warning.png" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label10" runat="server" Text="Cartera"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtCartera" runat="server" Enabled="false" Width="150px" ></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label7" runat="server" Text="Fecha"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txt_Fecha" runat="server" Width="150px" ></asp:TextBox>
                            <asp:CalendarExtender ID="calendar" runat="server" Format="yyyy-MM-dd" PopupButtonID="img_cal1"
                                TargetControlID="txt_Fecha">
                            </asp:CalendarExtender>
                            <asp:ImageButton ID="img_cal1" runat="server" ImageUrl="~/images/calendar.gif" />                            
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txt_Fecha"
                                Display="none" ErrorMessage="Campo Obligatorio!" ForeColor="red" ValidationGroup="g1" />
                            <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="Server" CloseImageUrl="~/images/close.gif"
                                CssClass="validatorCallout" HighlightCssClass="validatorCalloutHighlight" PopupPosition="Right"
                                TargetControlID="RequiredFieldValidator6" WarningIconImageUrl="~/images/Warning.png" />
                            <asp:RangeValidator ID="RangeValidator1" runat="server" Display="None" ControlToValidate="txt_Fecha" ForeColor="Red" ErrorMessage = "La fecha del operación no puede ser mayor al día de Hoy" />
                            <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender10" runat="server" CloseImageUrl="~/images/close.gif"
                                CssClass="validatorCallout" HighlightCssClass="validatorCalloutHighlight"
                                TargetControlID="RangeValidator1" WarningIconImageUrl="~/images/Warning.png" Enabled="True"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label1" runat="server" Text="Monto"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txt_Monto" runat="server" Width="200px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txt_Monto"
                                Display="none" ErrorMessage="Campo Obligatorio!" ForeColor="red" ValidationGroup="g1" />
                            <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender7" runat="Server" CloseImageUrl="~/images/close.gif"
                                CssClass="validatorCallout" HighlightCssClass="validatorCalloutHighlight" PopupPosition="Right"
                                TargetControlID="RequiredFieldValidator7" WarningIconImageUrl="~/images/Warning.png" />
                            <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Numbers,Custom"
                                ValidChars="." TargetControlID="txt_Monto" />                            
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Formato no válido, usa sólo números y un punto decimal"
                                Display="none" ValidationExpression="\d+(\.\d{1,11})?" ForeColor="Red"
                                ControlToValidate="txt_Monto" ValidationGroup="g1" />
                            <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender8" runat="Server" CloseImageUrl="~/images/close.gif"
                                CssClass="validatorCallout" HighlightCssClass="validatorCalloutHighlight" PopupPosition="Right"
                                TargetControlID="RegularExpressionValidator1" WarningIconImageUrl="~/images/Warning.png" />
                        </td>
                        <tr>
                            <td>
                            </td>
                            <td>
                                 <asp:Button ID="btn_Registrar" runat="server" CssClass="button2" Text="Registrar" ValidationGroup="g1" />                            
                                 <asp:Button ID="btn_update" runat="server" Alt="Actualizar" CssClass="button2" Text="Actualizar" Visible="false" ValidationGroup="g1" />
                                 <asp:Button ID="btn_cancel" runat="server" Alt="Cancelar" CssClass="button2" Text="Cancelar" CausesValidation="false" />
                            </td>
                        </tr>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:Label ID="lb_error" runat="server"></asp:Label>
                        </td>
                    </tr>
                </table>
                <asp:HiddenField ID="hf_repMovi" runat="server" />                
                    <div id="BusqMovimientos" class="divContent">    
                    <table class="tablaBusqueda">
                        <tr>
                            <td>
                                <asp:Label ID="Label4" runat="server" Text="Mov:"></asp:Label>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlRD" runat="server" Width="100px">
                                    <asp:ListItem Value="0">----</asp:ListItem>
                                    <asp:ListItem Value="1">Retiro</asp:ListItem>
                                    <asp:ListItem Value="2">Deposito</asp:ListItem> 
                                    <asp:ListItem Value="3">Rendimiento</asp:ListItem> 
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:Label ID="Label14" runat="server" Text="Desp:"></asp:Label>
                            </td>

                            <td>
                                <asp:DropDownList ID="ddlDespachoB" runat="server" Width="100px">
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:Label ID="Label15" runat="server" Text="Inst:"></asp:Label>
                            </td>
                            <td>               
                                <asp:TextBox ID="busqInst" runat="server" Width="100px" ></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="Label16" runat="server" Text="Cliente"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="busqCli" runat="server" Width="100px" ></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="Label17" runat="server" Text="FechaI"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtFechaI" runat="server" AutoPostBack="true" Width="100px" ReadOnly="false"></asp:TextBox>
                                <asp:ImageButton ID="img_cal3" runat="server" ImageUrl="~/images/calendar.gif" />
                                <asp:CalendarExtender ID="calendar3" runat="server" Format="yyyy-MM-dd" PopupButtonID="img_cal3"
                                    TargetControlID="txtFechaI" />
                            </td>
                            <td>
                                <asp:Label ID="Label18" runat="server" Text="FechaF"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtFechaF" runat="server" AutoPostBack="true" Width="100px" ReadOnly="false" ></asp:TextBox>
                                <asp:ImageButton ID="img_cal2" runat="server" ImageUrl="~/images/calendar.gif" />
                                <asp:CalendarExtender ID="calendar2" runat="server" Format="yyyy-MM-dd" PopupButtonID="img_cal2"
                                    TargetControlID="txtFechaF" />
                            </td>
                            <td>
                                <asp:ImageButton ID="btn_search" runat="server" CausesValidation="false" ImageUrl="~/images/Search44.png" />
                            </td>
                        </tr>

                    </table>
                </div>
                    <div class="tabla2">
                    <asp:GridView ID="gv_Movs" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                        PageSize="5" PagerStyle-CssClass="PagerColor" CssClass="Gridview" CellPadding="5"
                        FooterStyle-CssClass="HeaderFooterGridview"  GridLines="None" 
                        AlternatingRowStyle-CssClass="GridviewAlt" HorizontalAlign = "Center" 
                            Width="839px">                    
                    <AlternatingRowStyle CssClass="GridviewAlt" />
                        <Columns>
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="editarMov"
                                        Text="Editar" CommandArgument='<%# Bind("movi_id") %>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="eliminarMov"
                                        Text="Eliminar" CommandArgument='<%# Bind("movi_id") %>'></asp:LinkButton>
                                    <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1"   runat="server" TargetControlID="LinkButton2"
                                        ConfirmText="¿Estas seguro de eliminar el registro?">
                                    </asp:ConfirmButtonExtender>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="movi_tipo_op" HeaderText="Mov" />
                            <asp:BoundField DataField="inst_nombre" HeaderText="Inst" />
                            <asp:BoundField DataField="Contrato" HeaderText="Contrato" DataFormatString="{0:D}"  />
                            <asp:BoundField DataField="cliente" HeaderText="Cliente" />
                            <asp:BoundField DataField="movi_fecha_op" HeaderText="Fecha" DataFormatString="{0:dd-M-yyyy}" />
                            <asp:BoundField DataField="movi_monto" HeaderText="Monto" DataFormatString="{0:C}" />
                            <asp:BoundField DataField="despacho" HeaderText="Desp" />
                        </Columns>
                    </asp:GridView>
                </div>
                
                
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btn_search" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btn_Registrar" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
</div>
</center> 
